﻿using System;
using System.Net;
using System.Xml.Linq;

namespace ArmoryBrowser.Entities
{
    public class Defense
    {
        #region Fields
        private string _decreasePercentField;
        private string _increasePercentField;
        private string _plusDefenseField;
        private string _ratingField;
        private string _valueField;
        #endregion
        #region Properties
        public string DecreasePercent
        {
            get
            {
                return this._decreasePercentField;
            }
            set
            {
                this._decreasePercentField = value;
            }
        }

        public string IncreasePercent
        {
            get
            {
                return this._increasePercentField;
            }
            set
            {
                this._increasePercentField = value;
            }
        }

        public string PlusDefense
        {
            get
            {
                return this._plusDefenseField;
            }
            set
            {
                this._plusDefenseField = value;
            }
        }

        public string Rating
        {
            get
            {
                return this._ratingField;
            }
            set
            {
                this._ratingField = value;
            }
        }

        public string Value
        {
            get
            {
                return this._valueField;
            }
            set
            {
                this._valueField = value;
            }
        }
        #endregion
        #region Constructor
        public Defense(XElement element)
        {
            DecreasePercent = element.GetAttributeValue("decreasePercent");
            IncreasePercent = element.GetAttributeValue("increasePercent");
            PlusDefense = element.GetAttributeValue("plusDefense");
            Rating = element.GetAttributeValue("rating");
            Value = element.GetAttributeValue("value");
        }
        #endregion
    }
}
